package com.efast.dmom.aps.dao;

import java.time.LocalDate;
import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;

import com.efast.dmom.aps.bean.Shift;
import com.efast.dmom.aps.bean.WorkingCalendar;
import com.efast.dmom.aps.dao.base.BaseDao;
import com.efast.dmom.aps.entity.WorkingCalendarEntity;

public interface WorkingCalendarDao extends BaseDao<WorkingCalendarEntity>{
	/**
	 * 对日历进行批量新增操作
	 * 
	 * @param list
	 */
	public void insertWorkingCalendar(WorkingCalendar workingCalendar);

	/**
	 * 对日历进行批量更新操作
	 * 
	 * @param workingCalendar
	 */
	public void updateWorkingCalendar(WorkingCalendar workingCalendar);
	
	
	/**
	 * 查询所有的日历数据
	 * */
	List<WorkingCalendar> selectWorkingCalendar(Map<String,Object> map);
	
	/**
	 * 根据月份查询工作日历
	 * @param workingCalendar
	 * @return 
	 */
	public List<WorkingCalendar> getworkCanlendarByMonth(WorkingCalendar workingCalendar);

	
	
	/**
	 * //查询出中间表班次的数量
	 * @param workingCalendar
	 * @return
	 */
	
	public int selectShiftSum(WorkingCalendar workingCalendar);
	
	
	/**
	 * 新增班次
	 * @param workingCalendar
	 */
	public void insertShift(WorkingCalendar workingCalendar);
	
	/**
	 * 删除班次
	 * @param workingCalendar
	 */
	public void deleteShift(WorkingCalendar workingCalendar);
	
	
	/**
	 * 查询指定日期的班次信息
	 * @param workingCalendar
	 */
	public Shift selectShift(WorkingCalendar workingCalendar);
	
	/**
	 * 查询指定多个日期的日历信息
	 * @param workingCalendar
	 */
	public List<WorkingCalendar> getWorkingHoursPerDay(Map<String,Object> map);
	
	List<WorkingCalendar>selectcalendarsAndSchedulingCount(Map<String,Object> map);
	
	/**
	 * 通过指定的日历时间查询当前日期下的班次信息
	 * @param workingCalendar
	 */
	List<Map<String,Object>> queryShiftInfoByCalendar(WorkingCalendar workingCalendar);
	
	List<Map<String,Object>> workCalendarDataHandler(Map<String,Object> map);
	
	void updateCalendarStatus(Map<String,Object> map);
	
	void insertCalendarDatas(Map<String,Object> map);
	
	List<Long> queryCalendarByPlantWorkshopLine(Map<String,Object> map);
	
	void addCalendarShiftRel(Map<String,Object> map);
	void deleteCalendarShiftRel(Map<String,Object> map);
	
	List<Map<String,Object>> selectCalendarDataByCalendarDateList(Map<String,Object> map);
	
	WorkingCalendarEntity getWcByLineAndTime(@Param("lineId")long lineId,@Param("currentDate")LocalDate currentDate);
}
